package cn.edu.gzhu.workOrderManagement.pojo.dto.user;

import cn.edu.gzhu.workOrderManagement.constants.RegexConstant;
import cn.edu.gzhu.workOrderManagement.enumeration.UserAuthorityEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRegisterDto {
    @Pattern(regexp = RegexConstant.USERNAME,message = "用户名必须在4-16位之间，仅由字母数字下划线和减号组成")
    @NotBlank

    private String username;

    @Pattern(regexp = RegexConstant.PASSWORD,message = "密码中必须包含字母大小写、数字和特殊字符,且在6-18位之间")
    @NotBlank

    private String password;

    @NotBlank
    private String organization;

    @NotNull
    private UserAuthorityEnum authority;
}
